package com.zy.exception;

/**
 * @Author Gong
 * @Description
 * @dATE 2021/12/7 15:37
 **/
public class DivideZero {
    int x;
    public static void main(String[] args) {
        int y;
        DivideZero c=new DivideZero();
        try{
            y=3/c.x;
        }
        catch(ArithmeticException e){
            System.out.println("divide by zero error!");
        }
        System.out.println("program ends ok!");

    }

}
